﻿using System;

namespace Util.Web
{
    // V 1.0.2 - 2025-11-07 11:46:40
    // 增加 ByteArr, Hex
    //
    // V 1.0.1 - 2020-1-1 12:41:58
    // 增加 EntryTime
    // 
    // V 1.0.0
    // 首次创建    

    /// <summary>
    /// TcpXxxEventArgs
    /// </summary>
    public class TcpXxxEventArgs : EventArgs
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="msg"></param>
        public TcpXxxEventArgs(string msg)
        {
            this.Msg = msg;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="entryTime"></param>
        public TcpXxxEventArgs(string msg, DateTime entryTime)
        {
            this.Msg = msg;
            this.EntryTime = entryTime;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="from"></param>
        /// <param name="entryTime"></param>
        public TcpXxxEventArgs(string msg, string from, DateTime entryTime)
        {
            this.Msg = msg;
            this.From = from;
            this.EntryTime = entryTime;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="byteArr"></param>
        /// <param name="msg"></param>
        /// <param name="from"></param>
        /// <param name="entryTime"></param>
        /// <param name="hex"></param>
        public TcpXxxEventArgs(byte[] byteArr, string msg, string hex, string from, DateTime entryTime)
        {
            this.ByteArr = byteArr;
            this.Msg = msg;
            this.Hex = hex;
            this.From = from;
            this.EntryTime = entryTime;
        }

        /// <summary>
        /// 接收到的原始数据 ByteArr
        /// </summary>
        public byte[] ByteArr { get; private set; }

        /// <summary>
        /// Hex
        /// </summary>
        public string Hex { get; private set; }

        /// <summary>
        /// 根据 Encoding 转换的 String 信息
        /// </summary>
        public string Msg { get; private set; }

        /// <summary>
        /// 信息时间
        /// </summary>
        public DateTime EntryTime { get; private set; }

        /// <summary>
        /// 信息来源
        /// </summary>
        public string From { get; private set; }


    }
}
